import type { UserInfo } from "@/types/user";

const key = "userInfo";


export const setUserInfo = (value: UserInfo) => {
    uni.setStorageSync(key, value);
};

export const getUserInfo = () => {
    try {
        return uni.getStorageSync(key);
    } catch (error: any) {
        return {} as UserInfo;
    }
};

export const clearUserInfo = () => {
    uni.removeStorageSync(key);
};

